package com.utils;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 阿里云 - 请求参数配置
 * 对象存储OSS、视觉搜索
 * @author Howe Hsiang
 * @version 2.0
 * @date 2020-12-4 11:47
 */
@Component
public class AliyunConfig {

    /**
     * key值
     */
    private static String accessKeyId;

    /**
     * secret值
     */
    private static String accessKeySecret;

    /**
     * OSS的地址
     */
    private static String endPoint;

    /**
     * OSS的Bucket名称
     */
    private static String bucketName;

    /**
     * OSS的上传图片路径
     */
    private static String filePath;

    /**
     * OSS返回的URL
     */
    private static String ossUrl;

    /**
     * IS的图片数据库名称
     */
    private static String instanceName;

    public static String getAccessKeyId() {
        return accessKeyId;
    }

    @Value("${aliyun.access-key-id}")
    public void setAccessKeyId(String accessKeyId) {
        AliyunConfig.accessKeyId = accessKeyId;
    }

    public static String getAccessKeySecret() {
        return accessKeySecret;
    }

    @Value("${aliyun.access-key-secret}")
    public void setAccessKeySecret(String accessKeySecret) {
        AliyunConfig.accessKeySecret = accessKeySecret;
    }

    public static String getEndPoint() {
        return endPoint;
    }

    @Value("${aliyun.oss.end-point}")
    public void setEndPoint(String endPoint) {
        AliyunConfig.endPoint = endPoint;
    }

    public static String getBucketName() {
        return bucketName;
    }

    @Value("${aliyun.oss.bucket-name}")
    public void setBucketName(String bucketName) {
        AliyunConfig.bucketName = bucketName;
    }

    public static String getOssUrl() {
        return ossUrl;
    }

    @Value("${aliyun.oss.oss-url}")
    public void setOssUrl(String ossUrl) {
        AliyunConfig.ossUrl = ossUrl;
    }

    public static String getFilePath() {
        return filePath;
    }

    @Value("${aliyun.oss.file-path}")
    public void setFilePath(String filePath) {
        AliyunConfig.filePath = filePath;
    }

    public static String getInstanceName() {
        return instanceName;
    }

    @Value("${aliyun.searchimage.instance-name}")
    public void setInstanceName(String instanceName) {
        AliyunConfig.instanceName = instanceName;
    }
}
